import mediarequest from '@/utils/media-request'

// 获取媒资关联的商品
export function getMediaRelGoods(data) {
  return mediarequest({
    url: '/console/media/rel/goodss',
    method: 'get',
    params: data
  })
}

// 媒资关联商品
export function createMediaRelGoods(data) {
  return mediarequest({
    url: '/console/media/rel/goodss',
    method: 'post',
    data
  })
}

// 媒资覆盖关联商品
export function updateMediaRelGoods(data) {
  return mediarequest({
    url: '/console/media/rel/goodss',
    method: 'put',
    data
  })
}

// 删除媒资关联的商品
export function deleteMediaRelGoods(data) {
  return mediarequest({
    url: '/console/media/rel/goodss',
    method: 'delete',
    data
  })
}

// 媒资关联的商品排序
export function reSortMediaRelGoods(data) {
  return mediarequest({
    url: '/console/media/rel/goods__sequence',
    method: 'patch',
    data
  })
}

// 媒资关联的商品置顶和取消置顶
export function mediaGoodsToTop(data) {
  return mediarequest({
    url: '/console/media/rel/goods__topno',
    method: 'patch',
    data
  })
}

// 设置关联的商品是否售罄
export function updateRelGoods(data) {
  return mediarequest({
    url: '/console/media/rel/goods',
    method: 'patch',
    data
  })
}

// 获取子集关联的商品
export function getSeriesRelGoods(data) {
  return mediarequest({
    url: '/console/media/series/rel/goodss',
    method: 'get',
    params: data
  })
}

// 子集关联商品
export function createSeriesRelGoods(data) {
  return mediarequest({
    url: '/console/media/series/rel/goodss',
    method: 'post',
    data
  })
}

// 子集覆盖关联商品
export function updateSeriesRelGoods(data) {
  return mediarequest({
    url: '/console/media/series/rel/goodss',
    method: 'put',
    data
  })
}

// 删除子集关联的商品
export function deleteSeriesRelGoods(data) {
  return mediarequest({
    url: '/console/media/series/rel/goodss',
    method: 'delete',
    data
  })
}

// 子集关联的商品排序
export function reSortSeriesRelGoods(data) {
  return mediarequest({
    url: '/console/media/series/rel/goods',
    method: 'patch',
    data
  })
}

